/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entidad;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author pepe
 */
@Entity
@Table(name = "canal", catalog = "SBDB", schema = "")
@NamedQueries({
    @NamedQuery(name = "Canal.findAll", query = "SELECT c FROM Canal c")})
public class Canal implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id@GeneratedValue(strategy= GenerationType.IDENTITY)    
    @Basic(optional = false)
    @Column(name = "idCanal")
    private Integer idCanal;
    @Column(name = "nacional")
    private Boolean nacional;
    @Column(name = "nombre", unique=true)
    private String nombre;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "canal")
    private List<Registromonitoreovideo> registromonitoreovideoList;

    public Canal() {
    }

    public Canal(Integer idCanal) {
        this.idCanal = idCanal;
    }

    public Integer getIdCanal() {
        return idCanal;
    }

    public void setIdCanal(Integer idCanal) {
        this.idCanal = idCanal;
    }

    public Boolean getNacional() {
        return nacional;
    }

    public void setNacional(Boolean nacional) {
        this.nacional = nacional;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public List<Registromonitoreovideo> getRegistromonitoreovideoList() {
        return registromonitoreovideoList;
    }

    public void setRegistromonitoreovideoList(List<Registromonitoreovideo> registromonitoreovideoList) {
        this.registromonitoreovideoList = registromonitoreovideoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCanal != null ? idCanal.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Canal)) {
            return false;
        }
        Canal other = (Canal) object;
        if ((this.idCanal == null && other.idCanal != null) || (this.idCanal != null && !this.idCanal.equals(other.idCanal))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidad.Canal[ idCanal=" + idCanal + " ]";
    }
    
}
